package com.lazybones.base.engineer.controller.jasypt;

import com.lazybones.base.engineer.common.conf.jasypt.JasyptConfig;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/jasypt/")
public class JasyptController {
    private final JasyptConfig jasyptConfig;

    public JasyptController(JasyptConfig jasyptConfig) {
        this.jasyptConfig = jasyptConfig;
    }
    @RequestMapping(value = "encrtyText",method = RequestMethod.GET)
    public String encrtyText(@RequestParam("textValue") String textValue){
        String encrypt = jasyptConfig.encryptorPass(textValue);
        return encrypt;
    }
}
